class AddLoughSettings < ActiveRecord::Migration
  def self.up
    Lough.transaction do 
      add_column :loughs, :settings, :text
      
      Lough.find(:all).each do |l|
        l.lough_name = l.name
        l.save!
      end
      
      remove_column :loughs, :name
    end
  end

  def self.down
    Lough.transaction do
      add_column :loughs, :name, :string
      
      Lough.find(:all).each do |l|
        l.name = l.lough_name
        l.save!
      end
      
      remove_column :loughs, :settings
    end
  end
end
